package com.xpgk.mvc.ddc.ddc_vehicleChangeName;

import java.util.Date;

import com.jfinal.log.Log;
import com.xpgk.annotation.Service;
import com.xpgk.mvc.base.BaseService;
import com.xpgk.mvc.ddc.entity.Vehicle;

@Service(name = VehicleChangeNameService.serviceName)
public class VehicleChangeNameService extends BaseService{

	@SuppressWarnings("unused")
	private static final Log log = Log.getLog(VehicleChangeNameService.class);

	public static final String serviceName = "vehicleChangeNameService";
	
	public boolean  vehicleChangeName(Vehicle  newVehicle ,String oldIds,String clbg,String deptid) {
		boolean flag = true;
		
	//	String oldIds = newVehicle.getStr(Vehicle.column_ids);
		Vehicle c = Vehicle.dao.findById(oldIds);
		VehicleChangeName vehicleChangeName = new VehicleChangeName();
//		vehicleChangeName.set(VehicleChangeName.column_ids, oldIds)
//		.set(VehicleChangeName.column_CLPP1, c.getStr(Vehicle.column_CLPP1))
//		.set(VehicleChangeName.column_CLXH, c.getStr(Vehicle.column_CLXH))
//		.set(VehicleChangeName.column_GCJK, c.getStr(Vehicle.column_GCJK))
//		.set(VehicleChangeName.column_ZZG, c.getStr(Vehicle.column_ZZG))
//		.set(VehicleChangeName.column_ZZCMC, c.getStr(Vehicle.column_ZZCMC))
//		.set(VehicleChangeName.column_CLLX, c.getStr(Vehicle.column_CLLX))
//		.set(VehicleChangeName.column_CSYS, c.getStr(Vehicle.column_CSYS))
//		.set(VehicleChangeName.column_SYXZ, c.getStr(Vehicle.column_SYXZ))
//		.set(VehicleChangeName.column_SFZMHM, c.getStr(Vehicle.column_SFZMHM))
//		.set(VehicleChangeName.column_SFZMMC, c.getStr(Vehicle.column_SFZMMC))
//		.set(VehicleChangeName.column_SYR, c.getStr(Vehicle.column_SYR))
//		.set(VehicleChangeName.column_DJRQ, c.getDate(Vehicle.column_DJRQ))
//		.set(VehicleChangeName.column_FZJG, c.getStr(Vehicle.column_FZJG))
//		.set(VehicleChangeName.column_LSH, c.getStr(Vehicle.column_LSH))
//		.set(VehicleChangeName.column_GL, c.getBigDecimal(Vehicle.column_GL))
//		.set(VehicleChangeName.column_CWKC, c.getBigDecimal(Vehicle.column_CWKC))
//		.set(VehicleChangeName.column_CWKK, c.getBigDecimal(Vehicle.column_CWKK))
//		.set(VehicleChangeName.column_CWKG, c.getBigDecimal(Vehicle.column_CWKG))
//		.set(VehicleChangeName.column_ZZL, c.getBigDecimal(Vehicle.column_ZZL))
//		.set(VehicleChangeName.column_CCRQ, c.getDate(Vehicle.column_CCRQ))
//		.set(VehicleChangeName.column_LLPZ1, c.getStr(Vehicle.column_LLPZ1))
//		.set(VehicleChangeName.column_PZBH1, c.getStr(Vehicle.column_PZBH1))
//		.set(VehicleChangeName.column_HGZBH, c.getStr(Vehicle.column_HGZBH))
//		.set(VehicleChangeName.column_BZ, c.getStr(Vehicle.column_BZ))
//		.set(VehicleChangeName.column_ZSXXDZ, c.getStr(Vehicle.column_ZSXXDZ))
//		.set(VehicleChangeName.column_ZSXZQH, c.getStr(Vehicle.column_ZSXZQH))
//		.set(VehicleChangeName.column_ZZZ, c.getStr(Vehicle.column_ZZZ))
//		.set(VehicleChangeName.column_ZDYZT, c.getStr(Vehicle.column_ZDYZT))
//		.set(VehicleChangeName.column_SFCJ, c.getStr(Vehicle.column_SFCJ))
//		.set(VehicleChangeName.column_CJRZM, c.getStr(Vehicle.column_CJRZM))
//		.set(VehicleChangeName.column_SF60ZS, c.getStr(Vehicle.column_SF60ZS))
//		.set(VehicleChangeName.column_LNRZM, c.getStr(Vehicle.column_LNRZM))
//		.set(VehicleChangeName.column_zwx, c.getStr(Vehicle.column_zwx))
//		.set(VehicleChangeName.column_zyp, c.getStr(Vehicle.column_zyp))
//		.set(VehicleChangeName.column_synx, c.getStr(Vehicle.column_synx))
//		.set(VehicleChangeName.column_xsgl, c.getStr(Vehicle.column_xsgl))
//		.set(VehicleChangeName.column_orgid, c.getStr(Vehicle.column_orgid))
//		.set(VehicleChangeName.column_Nl, c.getStr(Vehicle.column_Nl))
//		.set(VehicleChangeName.column_XB, c.getStr(Vehicle.column_XB));
		
		
//		if(!vehicleChangeName.save(oldIds)){//保存旧数据到temp表
//			flag =false;
//		}
//		flag = c.delete();//删除旧数据
//		newVehicle.set(Vehicle.column_tempIds, oldIds)
//		.set(Vehicle.column_upateDate,new Date());
//		
//		if(clbg.equals("0")){
//			newVehicle.set(Vehicle.column_ZDYZT, "5");
//		}else{
//			newVehicle.set(Vehicle.column_ZDYZT, "6");
//		}
//		newVehicle.set(Vehicle.column_orgid, deptid);
//		flag=newVehicle.save();//新数据保存
		return flag;
		
	}
}
